{include file="public/header" /}
<body>
<style>
    .cion{
        display: inline-block;
        width: 120px;
    }
</style>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页
    <span class="c-gray en">&gt;</span> 会员管理
    <span class="c-gray en">&gt;</span> 实名认证
    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="/user/nameAuthList" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form  method="get" action="">
        <div class="text-c">
            日期范围：
            <input type="text" onfocus="WdatePicker()" value="{:input('get.start')}" name="start" id="datemin" class="input-text Wdate" style="width:120px;"autocomplete="off">
             -
            <input type="text" onfocus="WdatePicker()" value="{:input('get.end')}" name="end" id="datemax" class="input-text Wdate" style="width:120px;" autocomplete="off">
            <input type="text" class="input-text" style="width:250px" placeholder="UID" value="{:input('word')}" name="word">
            <input type="text" class="input-text" style="width:250px" placeholder="手机号" value="{:input('mobile')}" name="mobile">
            <input type="text" class="input-text" style="width:250px" placeholder="主账号" value="{:input('username')}" name="username">
            <span class="select-box" style="width: 100px;">
                <select name="status" class="select">
                    <option value="-1">全部状态</option>
                    <option value="0" {if isset($_GET['status']) && $_GET['status'] == 0}selected{/if}>审核中</option>
                    <option value="1" {if isset($_GET['status']) && $_GET['status'] == 1}selected{/if}>审核通过</option>
                    <option value="2" {if isset($_GET['status']) && $_GET['status'] == 2}selected{/if}>审核拒绝</option>
                </select>
            </span>
            <button type="submit" class="btn btn-success">搜索</button>
        </div>
    </form>

    <div class="cl pd-5 bg-1 bk-gray mt-20">
        <span class="l">
        </span>
        <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span> </div>
    <table class="table table-border table-bordered table-hover table-bg">
        <thead>
            <tr>
                <th scope="col" colspan="10">认证列表</th>
            </tr>
            <tr class="text-c">
                <th width="30">标识</th>
                <th width="150">用户</th>
<!--                <th width="150">主账号</th>-->
                <th width="150">手机号</th>
                <th width="150">身份证号</th>
<!--                <th width="100">正面照</th>-->
<!--                <th width="100">反面照</th>-->
<!--                <th width="100">手持身份证照/护照</th>-->
                <th width="100">申请时间</th>
                <th width="100">操作</th>
            </tr>
        </thead>
        <tbody>
            {foreach $list as $v}
            <tr class="text-c">
                <td class="text-l">
                    {$v.id}
                </td>
                <td class="text-l" >
                    用户id：{$v.uid} 真实名字：{$v.name}
                </td>
<!--                <td class="text-l" >-->
<!--                    主账号：{$v.username}-->
<!--                </td>-->
                <td class="text-l" >
                    手机号：{$v.mobile}
                </td>
                <td class="text-l">
                    {if $v.type == 1}
                        身份证:
                    {else/}
                        护照:
                    {/if}
                    {$v.cardno}
                </td>
<!--                <td><img src="{$v.positive_img}" style="width: 100px;height: 100px"  href="javascript:;" onclick="layopen('{$v.cardno}','{:url('imageShow',['src'=>$v.positive_img])}')"></td>-->
<!--                <td><img src="{$v.negative_img}" style="width: 100px;height: 100px"  href="javascript:;" onclick="layopen('{$v.cardno}','{:url('imageShow',['src'=>$v.negative_img])}')"></td>-->
<!--                <td><img src="{$v.img}" style="width: 100px;height: 100px"  href="javascript:;" onclick="layopen('{$v.cardno}','{:url('imageShow',['src'=>$v.img])}')"></td>-->
                <td>{:date('Y-m-d H:i:s',$v['time'])}</td>
                <td>
                    {switch name=$v.status}
                    {case value="0"}
                    <span class="label label-success radius" onclick="sp(this,{$v.id},1)">
                        通过</span>
                    <span class="label label-danger radius" onclick="sp(this,{$v.id},2)">
                        拒绝</span>
                    {/case}
                    {case value="1"}审核成功{/case}
                    {case value="2"}审核失败{/case}
                    {default /}无效状态
                    {/switch}
                </td>

            </tr>
            {/foreach}
        </tbody>
    </table>
    <div class="page">
        {$list->render()|raw}
    </div>
</div>

{include file="public/footer" /}

<script type="text/javascript">
function member_start(obj,id,status){
    if(status == 1){
        var info = '确认要通过审核吗？';
    }else{
        var info = '确认要用户重新提交资料吗？';
    }
    layer.confirm(info,function(index){
        $.ajax({
            type: 'POST',
            url: "{:url('status')}",
            data: {id:id,status:status},
            dataType: 'json',
            success: function(data){
                if(data.status == 'y'){
                    layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                        location.replace(location.href);
                    });
                }else{
                    layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                }
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    });
}
function sp(obj,id,profit_status){
    if(profit_status == 1){
        var info = '确认要通过审核吗？';
    }else{
        var info = '确认要用户重新提交资料吗？';
    }
    layer.confirm(info,function(index){
        $.ajax({
            type: 'POST',
            url: "{:url('nameAuthStatus')}",
            data: {id:id,status:profit_status},
            dataType: 'json',
            success: function(data){
                if(data.status == 'y'){
                    layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                        location.replace(location.href);
                    });
                }else{
                    layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                }
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    });
}
</script>